# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=cargo-bloat
pkgver=0.11.1
pkgrel=3
pkgdesc="Find out what takes most of the space in your Rust executable"
url="https://github.com/RazrFalcon/cargo-bloat"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"  # limited by rust/cargo
license="MIT"
depends="cargo cargo-auditable"
source="https://github.com/RazrFalcon/cargo-bloat/archive/v$pkgver/$pkgname-$pkgver.tar.gz
	lfs64.patch
	"

_cargo_opts="--frozen --features regex-filter"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -Dm755 target/release/cargo-bloat -t "$pkgdir"/usr/bin/
}

sha512sums="
e6f33c99a80473123929424f91782cc7d364f5b09de7d5aca55058c1e811b6fb68db241c89f9de9ce1b8688cd6d9ebb8d7dc2077f324d31603f1a9c40fac6f5c  cargo-bloat-0.11.1.tar.gz
c8bcfd8c08b36f3784c1bdc6dbdf8aecc6df66ca58ae42d448a549d812503d885a53aa0ea492802e79e903904c34534a637dcce1d7ba8afc8c8dd5ee3fd50eac  lfs64.patch
"
